package User;

import Book.Library;
import Operation.*;

import java.util.Scanner;

public class NormalUser extends Users {
    public NormalUser(String name) {
        super(name);
        this.iOperation = new IOperation[]{
                new ExitBook(),
                new FindBook(),
                new BorrowBook(),
                new BackBook()};
    }

    @Override
    public int menu() {
        System.out.println("====================");
        System.out.println("Hello " + getName() + "普通成员菜单");
        System.out.println("1、找书");
        System.out.println("2、借书");
        System.out.println("3、还书");
        System.out.println("0、退出");
        System.out.println("====================");
        System.out.println("请选择操作：");
        Scanner sc = new Scanner(System.in);
        return sc.nextInt();
    }

    @Override
    public void doOperation(int pos, Library library) {
        iOperation[pos].work(library);
    }

}
